package com.kitty.game.rank.model.record;

import lombok.Getter;
import lombok.Setter;

/**帮派资金排行榜记录*/
@Getter
@Setter
public class PartyCapitalRankRecord extends RankRecord {
    /**帮派ID*/
    private String gid;
    /**帮派名称*/
    private String name;
    /**帮派等级*/
    private short level;
    /**成员人数*/
    private short memberCount;
    /**帮派资金*/
    private int capital;

    public PartyCapitalRankRecord() {}

    public PartyCapitalRankRecord(String gid, String name, short level, short memberCount, int capital) {
        this.gid = gid;
        this.name = name;
        this.level = level;
        this.memberCount = memberCount;
        this.capital = capital;
    }

    @Override
    public int compareTo(RankRecord o) {
        /**按帮派资金从大到小排序*/
        PartyCapitalRankRecord other = (PartyCapitalRankRecord)o;
        if (capital != other.getCapital()) {
            return capital > other.getCapital() ? -1 : 1;
        }

        /**资金一样时，就按gid排序吧，保证不是同一个帮派就好了*/
        return gid.compareTo(other.getGid());
    }
}
